// TOWN DIALOGUE SCRIPT
//    Town 21: Fort Emergence

begintalkscript;

variables;

short i,j,k,r1,choice;

begintalknode;
	tag = 2;
	state = -1;
	nextstate = -1;
	condition = gf(2,2) == 0;
	text1 = "You leave the guest quarters and begin your exploration of Fort Emergence. Everything is new, and all of the construction was done very quickly. You hope that a ceiling doesn't collapse on you when getting breakfast.";
	text2 = "You work for Unspecified Services, and your commander, Anaximander, is somewhere off to the west. The first step of a long journey.";
	text3 = "(This might be a good time to save the game. To open the Save window, press the Disk button, type Command-S, or type F3 to quicksave.)";
	action = SET_SDF 2 2 1;

begintalknode;
	tag = 3;
	state = -1;
	nextstate = -1;
	condition = gf(2,3) == 0;
	text1 = "The offices of Unspecified Services is to the north. You walk by a supply cache to your right. A potion, labeled 'Emergency Restoration', has been left out. Perhaps for you.";
	text2 = "You're an important person now. Surely, nobody would mind if you took it.";
	text3 = "(To use a potion, open the inventory window and get a potion. To use an item, like a lamp, scroll, or potion, press the sunburst button next to it.)";
	action = SET_SDF 2 3 1;
	code =
		set_dialogue_pic(219); 
	break;
	
begintalknode;
	tag = 4;
	state = -1;
	nextstate = -1;
	condition = gf(2,4) == 0;
	text1 = "You see a bow and javelins on this storeroom table. They are crude and heavily used, perhaps dating to the earliest days of Avernum.";
	text2 = "When you attack an enemy, you will use your Default weapon. This can be a melee weapon (sword or spear) or a missile weapon (javelin or bow).";
	text3 = "(Get the javelins and equip them. You can switch your default weapon by pressing the buttons to the lower left, or by typing 's'.)";
	text4 = "(You can skip a character's turn in combat by clicking on it or pressing the Space Bar.)";	
	action = SET_SDF 2 4 1;
	code = 
		set_dialogue_pic(196);
	break;	

begintalknode;
	tag = 5;
	state = -1;
	nextstate = -1;
	condition = gf(21,13) == 0;
	text1 = "Your year of tedious service in the Avernite army has finally paid off. You have been chosen, on very short notice, to join Unspecified Services and travel to the surface.";
	text2 = "The surface! Out in the sun! You had never dared dream of it.";
	text3 = "First, however, you must complete your final training and testing. Happily, some equipment has been left for you. Two crude helms of thick lizardskin wait for you on the table nearby. You should take advantage of them before you move on.";
	action = SET_SDF 21 13 1;

begintalknode;
	tag = 6;
	state = -1;
	nextstate = -1;
	condition = gf(21,14) == 0;
	text1 = "When you travel up to the surface, you are likely to be attacked by hostile soldiers and beasts. Before you are allowed above, Avernum wants to make sure you can handle it.";
	text2 = "That is why, just ahead, several beasts have thoughtfully been left here for you. Once they are destroyed, Avernum will be confident in your abilities.";
	text4 = "(You are about to enter combat mode. Once battle has begun, to attack an enemy, select the space it is standing in. You will also get tips about spells and abilities you can use.)";
	action = SET_SDF 21 14 1;

begintalknode;
	tag = 7;
	state = -1;
	nextstate = -1;
	condition = 1;
	text1 = "Since both of the subterranean horrors left for you have been squished, the gates to the north open. Agents from Unspecified Services hurry through, eager to throw you into a teleporter and send you to Upper Avernum.";
	text2 = "From there, you will at last be able to step out onto the surface.";
	action = SET_SDF 21 15 3;

begintalknode;
	tag = 8;
	state = -1;
	nextstate = -1;
	condition = 1;
	text1 = "You are now in combat. Characters will take turns moving and attacking. Each turn you get a few action points. Everything you do (moving, using items, attacking, etc) costs action points. When you run out, your turn is over.";
	text2 = "To attack a foe, select the space it is standing in. The space your cursor is over will be tinted red. If there is an enemy in that space, it will glow.";
	code =
		set_dialogue_pic(169);
	break;



begintalknode; // guard
	tag = 13;
	condition = 1;
	text1 = "You're going to the surface!";
	text2 = "I've heard of you.";
	text3 = "Hope the Empire doesn't find us.";
	text4 = "You're so lucky.";
	text5 = "I hear you've seen a tree!";
	text6 = "Don't let the Empire know about us.";
	text7 = "Tell us about the outside!";
	text8 = "What is the sky like?";
	action = SPEECH_BUBBLE;
	code =
		cs();
		if (gf(308,9) == 0)
			as(get_ran(1,1,3));
			else as(get_ran(1,3,8));
	break;

begintalknode; // lizard
	tag = 14;
	condition = 1;
	text1 = "HISS.";
	text2 = "Hiss.";
	text3 = "Hsssss.";
	text4 = "Bite! Bite! Bite!";
	action = SPEECH_BUBBLE;
	code =
		cs();
		as(get_ran(1,1,4));
	break;

begintalknode; // gate guard
	tag = 15;
	condition = 1;
	text1 = "I saw the sky!";
	text2 = "It's so bright out there.";
	text3 = "The outside is ahead.";
	text4 = "Do you see the grass?";
	text5 = "This is where the Empire will attack.";
	text6 = "We need to be ready.";
	text7 = "Hello, explorer.";
	text8 = "The outdoors await.";
	action = SPEECH_BUBBLE;
	code =
		cs();
		as(get_ran(1,1,8));
	break;

begintalknode; // s gate guard
	tag = 16;
	condition = 1;
	text1 = "Wish I was at the north gate.";
	text2 = "Upper Avernum is south.";
	text3 = "It's just more underworld out there.";
	text4 = "Sometimes the bandits come.";
	text5 = "The goblins are scouting us.";
	text6 = "Be careful on the roads.";
	action = SPEECH_BUBBLE;
	code =
		cs();
		as(get_ran(1,1,6));
	break;

begintalknode; // cat
	tag = 17;
	condition = 1;
	text1 = "Meow.";
	text2 = "Meow?";
	text3 = "Hssss.";
	action = SPEECH_BUBBLE;
	code =
		cs();
		as(get_ran(1,1,3));
	break;

begintalknode; // sheep
	tag = 18;
	condition = 1;
	text1 = "Baaaa.";
	text2 = "Baa.";
	text3 = "BAAA!";
	action = SPEECH_BUBBLE;
	code =
		cs();
		as(get_ran(1,1,3));
	break;

begintalknode; // cow
	tag = 19;
	condition = 1;
	text1 = "Moo.";
	text2 = "Mooooooooooo.";
	text3 = "Moo?";
	action = SPEECH_BUBBLE;
	code =
		cs();
		as(get_ran(1,1,3));
	break;

begintalknode;
	tag = 20;
	condition = 1;
	text1 = "__";

begintalknode;
	tag = 21;
	condition = 1;
	text1 = "__";

begintalknode;
	tag = 22;
	condition = 1;
	text1 = "__";


// Anaximander

begintalknode;
	tag = 40;
	state = -1;
	nextstate = 1;
	question = "Anaximander";
	text1 = "You greet Anaximander, commander of spying and special forces for Fort Emergence. He is a very fidgety, nervous man. He nods to you as you enter the room.";
	text2 = "_I am glad you arrived from the Tower of Magi safely. Welcome, friend. I am normally called just Anaximander. I have some titles and ranks but prefer not to use them. You have more questions?_";
	text5 = "Anaximander smiles nervously. _Anything else I can help you with? Before you return to your explorations? I know you have a lot to do._";
	action = INTRO;

begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(21,26) == 0;
	question = "_Greetings. I am reporting for duty._";
	text1 = "_Excellent. I am pleased that you are available for the surface explorations. After what happened to the first group to explore the surface, well, we were worried about getting anyone else to go out quickly enough._";
	text2 = "_I'm glad that your journey from the Tower of Magi was a safe one. We know that you are far less experienced than is desirable for a mission of this delicacy and urgency. But, well, sometimes we have to do what we can with what we have._";
	action = SET_SDF 21 26 1;

begintalknode;
	state = 1;
	nextstate = 2;
	condition = gf(21,26) >= 1;
	question = "_What is my overall mission?_";
	text1 = "_It is my job to give you instruction in your exploration of the surface world. It is a great honor that has fallen to you, to be given such a task. First, you will need to emerge onto the surface and develop an idea of conditions there._";
	text3 = "_Now that you have been on the surface and know that it is not immediately lethal, you need to explore it and determine as much as possible the situation there. Your ultimate goal: bringing about a way for us Avernites to return to the surface safely._";
	text5 = "_Your ultimate mission is to complete our bargain with Empress Prazac. If we do what she asked, you will finally win Avernites a place back on the surface._";
	code =	
		cs();
		if (gf(308,9) == 0)
			as(1);
			else if (gf(308,8) == 0)
				as(3);
				else as(5);
	break;
	

begintalknode;
	state = 2;
	nextstate = 3;
	condition = gf(308,9) == 0;
	question = "_Are we close to the surface here?_";
	text1 = "_Oh, yes. This fort is well-concealed inside a small mountain. Simply leave this fort through the north exit and you will be outside._";
	text2 = "_What you will find in your travels there, we still have little idea. This is your task: to look out and report back. And, if you merit it, you will be rewarded._";

begintalknode;
	state = 3;
	nextstate = -1;
	question = "_Didn't you explore the surface while building this fort?_";
	text1 = "_Only the immediate area. We looked around enough to verify that no Empire camps were nearby. Then we did all we could to keep them from finding this place._";
	text2 = "_We only sent out one group to explore farther. They never returned._";

begintalknode;
	state = 3;
	nextstate = 4;
	question = "_What else should I do?_";
	text1 = "_Constantly return to see me and tell me what you have found. Come into my office to give reports. I will, in turn, give you instructions for how to proceed._ His expression grows stern.";
	text2 = "_How we greet the Empire will determine much of the survival of Avernum in the future. Care is essential._";

begintalknode;
	state = 4;
	nextstate = -1;
	question = "_I can't make any promises, but I'll try to stay out of trouble._";
	text1 = "_Good. Be careful. Don't commit grotesque crimes. Keep a low profile. Don't murder people. That sort of thing._";

begintalknode;
	state = 4;
	nextstate = -1;
	question = "_Do you know what is happening in the Empire?_";
	text1 = "_Since the war with the Empire, we have heard nothing of them. Hopefully, this means they are rethinking how to deal with us. Perhaps, now that they know we have strong allies, we may negotiate with them._";
	text2 = "_In particular, we may be able to get them to let us have some land on the surface. Your job is to let us know what's happening, so we can gauge if that is possible._";

begintalknode;
	state = 3;
	nextstate = 152;
	question = "_Exactly what sort of rewards can I get?_";
	text1 = "_There are many ways we can reward you for bravery, persistence, and courage. In particular, we will give you magical spells and items. For the items, go to Levy._";
	text2 = "_For the spells, you will need to go the Portal Fortress to be sent back to Avernum._";

begintalknode;
	state = 152;
	nextstate = 3;
	question = "_And Levy is where, exactly?_";
	text1 = "_He is the quartermaster for all exceptional goods. His office is to the east._";

begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(21,26) >= 1;
	question = "_Tell me more about Fort Emergence._";
	text1 = "_It is a hollowed-out fort below a mountain on the surface. If you leave to the north, you will emerge on the surface. There is an Empire city a day's march to the southeast. If you leave Fort Emergence to the south, you will be in Upper Avernum._";

begintalknode;
	state = 2;
	nextstate = 5;
	question = "_Why do we need to explore the surface?_";
	text1 = "_At this point, we need to know what the Empire has been up to. Both we and our allies need to know. Soon, you should leave through the concealed hill entrance to the north, explore and report back. You can spend some time building strength first._";
	text3 = "_Avernum is a political power now, with actual allies. We need to find out as much as possible about the situation on the surface. Most importantly, we need to find out if it is possible to negotiate for land there._";
	action = DEP_ON_SDF 308 9 0;

begintalknode;
	state = 5;
	nextstate = 8;
	question = "_Exactly who are our allies?_";
	text1 = "_We are negotiating with the nephilim. Many of the slithzerikai fight alongside us._";
	text2 = "_And, most importantly, we have the vahnatai._";
	text3 = "_Then there are the vahnatai. They were allies, we thought. Now ..._ He shakes his head.";
	code =
		if (gf(308,7) == 0)
			rs(3);
			else rs(2);
	break;
	
begintalknode;
	state = 8;
	nextstate = 2;
	question = "_I haven't met many slithzerikai._";
	text1 = "_There are a number of the intelligent lizard people left. Ever since the Empire butchered thousands of innocent sliths in their invasion, we've been close allies. Once, we fought great wars with them, before we realized we had more in common than we thought._";

begintalknode;
	state = 8;
	nextstate = 150;
	question = "_What do you know about the Vahnatai?_";
	text1 = "_The vahnatai are powerful beings who live far below us. They have a settlement in the caves to the north, called Ghikra._";
	text2 = "_They were invaluable in winning the war against the Empire. Their magic is powerful, and their hatred of the Empire is boundless._";
	text3 = "_They were... they..._ He seems stunned. _They were... they are destroying our home. They are destroying the surface world. They were our allies, but now they are our enemies. It is so strange. I don't understand it. Yet now, fight them we must._";
	action = DEP_ON_SDF 308 7 0;

begintalknode;
	state = 2;
	nextstate = 7;
	question = "_Can you give me some pointers for building up my strength?_";
	text1 = "_Yes. Practice fighting and working as a team. Leave the fort to the south, and you will be in Upper Avernum. To the northeast are lairs of both goblins and bandits. Somewhere in these offices is a map to there. Practice fighting there, if you wish._";
	text3 = "_At this point, you can learn the most and advance your skills with the most speed by exploring the surface and learning what you can about the strange monsters there._";
	action = DEP_ON_SDF 307 1 0;
	code =
		sf(22,22,1);
	break;
	
begintalknode;
	state = 7;
	nextstate = -1;
	condition = gf(21,11) <= 1;
	question = "_Any missions I can do to help this fort out?_";
	text1 = "_Talk to Captain Johnson. He can usually be found in the barracks dining hall, to the south._";
	text2 = "_The military has been busy preparing to deal with threats from the surface. They've been hoping some adventurers will solve other, minor problems for them._";

begintalknode;
	state = 150;
	nextstate = -1;
	condition = gf(308,7) == 0;
	question = "_How can I get to Ghikra?_";
	text1 = "_To meet the vahnatai, leave Fort Emergence to the south, and head north through the caves. It's to the east of a huge lake._";

begintalknode;
	state = 2;
	nextstate = 151;
	condition = gf(308,10) == 0;
	question = "_My task is a great honor and a great burden. I'm pretty new to all this._";
	text1 = "_Much thought went into the decision of who to send to the surface first. First, we decided to send older adventurers, with skills well-honed for the surface. Then they disappeared. Sadly, you were not our first choice, but we have faith in you._";
	text2 = "_Your inexperience may be a greater aid on the surface than you think. You are not overly reliant on skills useful only in the underworld. And, of course, we will be sending other spies._";

begintalknode;
	state = 151;
	nextstate = -1;
	question = "_Where will these spies be going?_";
	text1 = "_More than that I don't want to say. Suffice it to say that soon after you leave, others will fan out onto the surface to gather information. Don't look for them. Instead, trust them to find you._";

begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(308,6) == 2;
	question = "_Tell me more about the theft of the Orb of Thralni._";
	text1 = "_Recently, Heavens only know how, some thieves broke in and stole the Orb of Thralni, one of Avernum's most valuable and powerful magical artifacts._";
	text2 = "_Perhaps, if you have the time, you could investigate. Speak with Levy, to the east. He was caretaker of the orb._";

begintalknode;
	state = 1;
	nextstate = 156;
	condition = gf(308,5) <= 2 && gf(21,26) >= 1;
	question = "_Can I ever return to the Tower of Magi?_";
	text1 = "_Yes. The Tower of Magi is the source of magic in Avernum. There are mages, Solberg and X, who have agreed to give you spells as rewards should you achieve any mighty deeds on the surface._";
	text2 = "_You can get there by entering Upper Avernum and going back to the Portal Fortress, to the west._";
	text3 = "Anaximander looks grim. _You must. Somehow, the Tower of Magi was seized by mighty demons. We've lost control of the portal! We need you to analyze the situation. You need to go to the Portal Fortress immediately!_";
	action = DEP_ON_SDF 308 5 0;

begintalknode;
	state = 152;
	nextstate = -1;
	question = "_Tell me about the Portal Fortress._";
	text1 = "_The Portal Fortress contains the teleporter between here and Avernum. The portal will send you to the Tower of Magi. To get there, leave Fort Emergence to the south and follow the road. Signs will lead you there._";

begintalknode;
	state = 1;
	nextstate = 153;
	condition = gf(308,4) >= 1 && gf(308,4) <= 3;
	question = "_I heard that there was a murder near New Formello._";
	text1 = "He looks at the door, to make sure nobody is eavesdropping.";
	text2 = "_It is worse. There has been a mysterious and bizarre series of murders in New Formello, in the caves to the far northwest. I have sent Flanagan to investigate, but somehow I feel that is not sufficient. You should go there and speak with him._";
	text3 = "_Yes. And, as I understand it, there a mysterious new cavern has appeared north of there. Explore it until you find evidence which might lead to who created it. I strongly believe that there is something of use there._";
	action = DEP_ON_SDF 308 4 1;

begintalknode;
	state = 153;
	nextstate = -1;
	question = "_Is Flanagan incompetent?_";
	text1 = "_No, he is skilled enough, but strange magic is involved. I would prefer you to go up to investigate as well. The timing of these events is suspicious. Somehow I think you may find things relevant to your quest._";

begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(21,26) >= 1 && gf(308,9) >= 1;
	question = "_I've done some exploring. Can you give me more instructions?_";
	text1 = "_We have sent a handful of scouts to the surface, but none of them have reported back. Our most desperate need is for a fresh report about what is happening outside. If the Empire has found us and is about to destroy us, we need to know._";
	text2 = "_Keep finding out what is happening, and, if you get the chance, keep the monster plagues from doing too much damage. If the surface world is destroyed, we will have nothing to return to. If you work as well as you have been, you will be rewarded._";
	text3 = "_We've received some more information on the surface world since the alliance with Prazac. The most dangerous and most potentially useful area to explore is the ruined land of Footracer Province, in northwest Valorim._";
	code =
		cs();
		if (gf(308,8) > 0)
			as(3);
			else if (gf(307,1) > 0)
				as(2);
				else as(1);
	break;

begintalknode;
	state = 2;
	nextstate = 3;
	condition = gf(308,9) >= 1;
	question = "_Now that we know that the exit to the surface is safe, where should I go?_";
	text1 = "_Everywhere you can. Meet people, discreetly, of course. Assist them when you feel it would advance the cause of Avernum. And, if you ever have a chance to advance our cause with people in power, you should do so._";
	text3 = "_Now that we have completed the treaty with Empress Prazac, you have one goal and one set of orders. Find and destroy the source of the plagues. If you succeed, and if Prazac is a woman of her honor, the imprisonment of the Avernites will come to an end._";
	action = DEP_ON_SDF 308 8 1;

begintalknode;
	state = 1;
	nextstate = 154;
	condition = gf(21,26) >= 1;
	question = "_Tell me of the group that went to the surface before me._";
	text1 = "_Well, the first group which went to the surface was very experienced in the ways of adventuring, and very carefully trained. They went up. And they haven't been heard from since. Thus, we selected you for the second attempt._";
	text3 = "_Well, the first group which went to the surface was very experienced in the ways of adventuring, and very carefully trained. And it would appear, from what you have found out, that they did not meet with a happy end. Thus, we selected you._";
	action = DEP_ON_SDF 307 14 0;

begintalknode;
	state = 154;
	nextstate = 155;
	question = "_Why didn't you send up someone more experienced than me?_";
	text1 = "He sighs. _It is complicated. Avernum politics. You see, there was much controversy in the Council about whether we should send anyone to the surface. They gave us a six month charter to send people up._";
	text2 = "_Six months was all the faction who wished to send people to the surface could get out of the faction which wished to remain hidden._";

begintalknode;
	state = 155;
	nextstate = -1;
	question = "_So our time is limited?_";
	text1 = "_Exactly. When the first group disappeared, we realized that we could never get permission to send more people up, not for years, at least. So we grabbed the most competent group of adventurers we could find. That is you._";
	text3 = "_Not anymore. Now that we have signed the treaty with Prazac, the faction in favor of hiding has withdrawn their objections. Of course, they have no choice._";
	action = DEP_ON_SDF 308 8 0;

begintalknode;
	state = 154;
	nextstate = -1;
	condition = gf(307,15) == 0;
	question = "_Tell me more about the first group?_";
	text1 = "_There were four of them. Their names were, well, are Erin, Elsner, Gwost, and Tucker. If you can find out anything about what happened to them, please let me know. It is of great interest to us._";
	text3 = "_There were four of them. Their names were, well, are Erin, Elsner, Gwost, and Tucker. The more information you can return to us about what happened to them, the better._";
	action = DEP_ON_SDF 307 14 0;
	code =
		sf(21,16,1);
		toggle_quest(90,1);
		toggle_quest(91,1);
		toggle_quest(92,1);
		toggle_quest(93,1);
	break;
	
begintalknode;
	state = 156;
	nextstate = -1;
	condition = gf(308,5) >= 3;
	question = "_Now that the Tower of Magi has been destroyed, where can I find X and Solberg?_";
	text1 = "_They are in this fort right now. I'm not sure where they are at this very moment, but look around. They're here somewhere._";

begintalknode;
	state = 1;
	nextstate = 157;
	condition = gf(21,26) >= 1;
	question = "_I would like to know more about you._";
	text1 = "Anaximander shrugs. _There is little to say. I am a functionary. An organizer. I choose capable adventurers, send them out, hope they function, and give rewards._";
	text2 = "_I am Avernum-born. I have never been out in the light. I volunteered to come up here so that my children would have a chance to live safe in the sun._";

begintalknode;
	state = 157;
	nextstate = -1;
	condition = 1;
	question = "_Why was your family originally sent to Avernum?_";
	text1 = "He chuckles. _Honestly? They never told me. It is common for their generation. They never spoke of the crimes the tyrant claimed they committed._";

begintalknode;
	state = 157;
	nextstate = -1;
	condition = 1;
	question = "_You really never went outside?_";
	text1 = "_I stood at the north gate of Fort Emergence once. Looked out into the blinding light. Caught a glimpse of the sky. So huge. Then I turned back. I admit, I was afraid._";
	text2 = "_I will go out someday. When our people are free._";

begintalknode;
	state = 157;
	nextstate = -1;
	condition = 1;
	question = "_You have children?_";
	text1 = "_Yes, safe in the underworld. I wouldn't let them come here. If the Empire finds this place, we might all be wiped out in hours._";

begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(309,0) >= 1 && gf(308,7) == 0 && gf(22,23) == 0;
	question = "_Do you think that Erika is responsible for the creature plagues?_";
	text1 = "_Honestly? I am not sure. Her hatred of the Empire knows no bounds, and, because of a curse they once laid on her, she can never return to the surface. The best way to see is to make contact with her. Her tower is to the north. You should drop by._";
	text3 = "_The way she has behaved, I am still not sure. You should not act against her until you are absolutely sure she is responsible. She can assist you in many ways, even if she is the one creating the monsters._";
	action = DEP_ON_SDF 47 8 0;
	code =
		sf(22,23,1);
	break;
	
begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(309,1) >= 1 && gf(308,7) == 0 && gf(22,24) == 0;
	question = "_Might the three great dragons be responsible for the surface plagues?_";
	text1 = "_Khoth, Athron, and Sulfras have every reason to hate the Empire. The Empire has slain most of the world's dragons. Revenge is a reasonable desire._";
	text2 = "_The three dragons have left Avernum for the surface. They may be up there somewhere. You should seek them and, if you find them, ask them what they know._";
	code =
		sf(22,24,1);
	break;

begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(309,8) >= 1 && gf(308,7) == 0 && gf(22,25) == 0;
	question = "_Do you think that the vahnatai are responsible for the surface plagues?_";
	text1 = "_The Empire, in their war with us, stole three of the vahnatai's Crystal Souls. To them, there is no greater crime, and their leader, Rentar-Ihrno, did swear vengeance._";
	text2 = "_Possible? Yes. Yes, it is._";
	code =
		sf(22,25,1);
	break;

begintalknode;
	state = 1;
	nextstate = -1;
	condition = gf(308,7) >= 1 && gf(22,26) == 0;
	question = "_How is Avernum responding to the news that the vahnatai are responsible for the destruction of the surface?_";
	text1 = "_Badly, as you might imagine. We had supposed the vahnatai our allies. Now, we aren't sure. Was this the work of a faction among them or of all of them in concert? We are trying to find out._";
	text2 = "_No news will come soon, however. The vahnatai in Avernum have all disappeared. Attempts to communicate with them have come to naught. And the humans in vahnatai lands? We have heard nothing from them. We are very concerned._";
	code =
		sf(22,26,1);
	break;

// Levy

begintalknode;
	tag = 60;
	state = -1;
	nextstate = 29;
	question = "Levy";
	text1 = "A pale Avernite, impeccably dressed and with neatly cut hair, waits behind the counter. As you approach, he checks his notes. _Ah, yes. The surface explorer. I am Levy, quartermaster and keeper of the Orb of Thralni. How may I help you?_";
	text5 = "Levy leans back in his chair behind the counter. _Is there something else you need? Any more valuable supplies you wish to absorb?_";
	action = INTRO;

begintalknode;
	state = 29;
	nextstate = 30;
	question = "_What are your responsibilities?_";
	text1 = "_I am in charge of making allowances for those in Avernum's employ. I also provide rewards for those who perform exceptional services. And I obtain equipment to supply the soldiers here._";
	text2 = "_As official Avernite envoys, you are entitled to a per diem, as well as rewards for notable achievements._";

begintalknode;
	state = 30;
	nextstate = -1;
	question = "_May I have my daily allowance?_";
	code =
		run_hardcode(100);
	break;

begintalknode;
	state = 30;
	nextstate = -1;
	question = "_Have my achievements merited a reward yet?_";
	code =
		run_hardcode(101);
	break;

begintalknode;
	state = 30;
	nextstate = 29;
	question = "_Can I get more supplies?_";
	text1 = "_You can help yourself to some basic weaponry and armor in the storerooms. Beyond that, you will have to forage on the surface. We have little to spare here. Anything else?_";
	
begintalknode;
	state = 30;
	nextstate = 29;
	question = "_That is all I need._";
	text1 = "_I am glad to hear it. Anything else?_";

begintalknode;
	state = 29;
	nextstate = 31;
	condition = gf(308,6) <= 2;
	question = "_Tell me about the Orb of Thralni._";
	text1 = "He gives you a small, smug smile. _I am entrusted with the guardianship of Thralni's Sphere._";
	text3 = "He looks ill. _I was entrusted with the guardianship of Thralni's Sphere. Then it was stolen._";
	action = DEP_ON_SDF 308 6 0;

begintalknode;
	state = 31;
	nextstate = 32;
	condition = gf(308,6) <= 2;
	question = "_What is the Orb of Thralni?_";
	text1 = "_An irreplaceable and ancient artifact. It gives its possessor the power of flight._ He flashes you another small, tight smile. _If you ever need to borrow it, be sure to give me a request._";
	text3 = "_It was the only artifact known to give the power of flight. It is gone now. Stolen._";
	action = DEP_ON_SDF 308 6 0;

begintalknode;
	state = 32;
	nextstate = -1;
	condition = gf(308,6) <= 0;
	question = "_Sounds useful, may I borrow it?_";
	text1 = "He smiles smugly. Without even bothering to think, he says, _Request denied. Perhaps you could request again later. Though I doubt it will do you any good._ You resist the urge to punch him.";

begintalknode;
	state = 31;
	nextstate = 33;
	condition = gf(308,6) >= 1 && gf(308,6) <= 2;
	question = "_How was the orb stolen?_";
	text1 = "_There was an explosion in the middle of the night. We went to the orb's vault and found it ravaged and empty. There was no way anyone could have snuck in. We think the thieves teleported in!_";

begintalknode;
	state = 33;
	nextstate = 34;
	question = "_Any idea how they could have teleported in and out?_";
	text1 = "_No, but it's the only way they could have entered. Fortunately, Seles, Avernum's best teleportation expert, came here to investigate, and she agreed with my guess. She said that anyone interested in tracking the thieves should go see her._";
	code =
		toggle_quest(13,3);
		toggle_quest(14,1);
	break;

begintalknode;
	state = 34;
	nextstate = -1;
	question = "_Where is Seles?_";
	text1 = "_She lives at the Portal Keep. She might help you to recover the orb._";

begintalknode;
	state = 29;
	nextstate = -1;
	condition = gf(308,6) >= 3;
	question = "_I recovered the Orb of Thralni._";
	text1 = "_So I heard._ He sighs. _I would love to have it back in my care, but my superiors had already decided that it was to be turned over to you for your use. So I guess you can keep it._ He shakes his head sadly. _I miss it._";

begintalknode;
	state = 29;
	nextstate = -1;
	question = "_Can I trade with you?_";
	text1 = "You conclude your business.";
	code =
		begin_shop_mode("Levy's Supplies","Levy keeps a cash reserve, which he uses to buy items to supply Fort Emergence. He also has some healing supplies for sale, if you need them.",0,5,1);
	break;
	
begintalknode;
	state = 29;
	nextstate = -1;
	condition = 1;
	question = "_I have something I want to sell._";
	text1 = "You conclude your business.";	
	code = 
		begin_sell_mode();
	break;

begintalknode;
	state = 29;
	nextstate = -1;
	question = "_I would like to learn magic._";
	text1 = "_Of course. This isn't the Empire. You are free to gain power without some bureaucrat's permission._";
	text2 = "_I think we have some trainers around the fort. Eva? Yanmitho? I think them. See if they're still stationed here._"; 
	
begintalknode;
	state = 29;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "_That is all I need for now._";
	text1 = "_Then I wish you safe travels. Good luck on the surface, and all that._";
	action = END_TALK;

// Marian

begintalknode;
	tag = 80;
	state = -1;
	nextstate = 57;
	question = "Marian";
	text1 = "You meet a small, heavy-set woman with a friendly attitude and radiant smile. Her long robes have been patched many times in her travels. She shakes your hand when you approach. _I'm Marian. Hi there!_";
	text5 = "Marian smiles and leans against a huge crate of supplies. _What else were you wanting to know?_";
	action = INTRO;

begintalknode;
	state = 57;
	nextstate = 58;
	question = "_What sort of work do you do?_";
	text1 = "_Well, let's see. In deep Avernum, real Avernum, I was doing research in Motrax's Cave. The dragon, I mean. Then everything up here seemed more important, so I came to Fort Emergence to help out._";
	action = SET_SDF 21 17 1;

begintalknode;
	state = 58;
	nextstate = 59;
	question = "_Who is Motrax?_";
	text1 = "She grows sad. _Poor old Motrax. There were five dragons in Avernum, and Motrax was the oldest and kindest. In the Empire War a band of those bastards tried to slay him. The wounds he received weakened him. He died after a long illness._";
	text2 = "_After that, the place had too many sad memories for us. I mean me and the captain over there._ She nods toward the office to the south.";

begintalknode;
	state = 58;
	nextstate = -1;
	question = "_What do you think about Fort Emergence?_";
	text1 = "_It takes a lot of time and work to bring people up from the underworld, and it's frightening being so close to the Empire. That's why we're so shorthanded now. It's so important to have volunteers come._";

begintalknode;
	state = 58;
	nextstate = -1;
	question = "_What is the important work?_";
	text1 = "_You know, this whole finally returning to the surface thing!_";
	text3 = "_You know, this whole finally retaking the surface thing! I don't need to tell you about it. You've actually been up there!_";
	action = DEP_ON_SDF 308 9 0;

begintalknode;
	state = 58;
	nextstate = 60;
	question = "_What do you help with now?_";
	text1 = "_I look after the supplies. It's dull, and the pay stinks, but I'm closer to the surface than I ever thought I'd be able to be._";

begintalknode;
	state = 60;
	nextstate = -1;
	question = "_Are you looking forward to returning to the surface?_";
	text1 = "_By the gods, yes! The surface! Finally! Seems like a dream come true._";
	text3 = "_By the gods yes. The surface! Finally! It's a dream which you're about to make come true!_ Impulsively, she throws her arms around you and gives you a hug. Then she steps back. _Sorry. I just can't wait until you succeed._";
	action = DEP_ON_SDF 308 8 0;

begintalknode;
	state = 59;
	nextstate = -1;
	question = "_The captain?_";
	text1 = "_Captain Ko. He's somewhere around here. He's a, shall we say, rather good friend of mine._ She grins.";

begintalknode;
	state = 57;
	nextstate = 61;
	condition = gf(21,17) > 0;
	question = "_A dragon was your friend?_";
	text1 = "She briefly relives some sad memories. _Yes. He was. He was strange and old and I could never truly understand him, but, well, yes. We were friends. In his age and weakness, he understood much more what it was to be human._";
	text3 = "She frowns. _Yes, and I don't wish to talk to you about it anymore. You clearly don't understand._";
	action = DEP_ON_SDF 21 28 0;

begintalknode;
	state = 61;
	nextstate = -1;
	condition = gf(21,28) == 0;
	question = "_I wish I had been able to meet him._";
	text1 = "She starts to respond, but she soon has to struggle to hold back tears. _Sorry ... I ... I miss him terribly. Excuse me ..._ She turns away.";
	action = END_TALK;

begintalknode;
	state = 61;
	nextstate = -1;
	condition = gf(21,28) == 0;
	question = "_That sounds like foolishness to me. Dragons are our enemies. This is well-known._";
	text1 = "Marian's pleasant exterior disappears in a moment. She looks furious. _Then it is you who are the fool. You speak of things of which you have no knowledge. I will speak of it with you no more._";
	action = SET_SDF 21 28 1;

begintalknode;
	state = 57;
	nextstate = -1;
	question = "_You are a mage?_";
	text1 = "_More a sage, but I can cast a few spells. I know things seem peaceful, but if the Empire finds this hidden fort, we'll be in a battle for our lives._";

// Ko

begintalknode;
	tag = 100;
	state = -1;
	nextstate = 85;
	question = "Ko";
	text1 = "You meet a Captain of the Avernum army. He's very thin, somewhat hyper, and undeniably friendly. _I'm Ko. Ummm, Captain Ko. ... Oh, just go ahead and say Ko. Guardian of supplies!  Greetings!_ He shakes your hands vigorously.";
	text5 = "Captain Ko waits to see how else he can help you. He is very eager to help.";
	action = INTRO;

begintalknode;
	state = 85;
	nextstate = 86;
	question = "_How go things at Fort Emergence?_";
	text1 = "_Well, right now there isn't much fighting. Fortunately. I just help Marian with the supplies._";

begintalknode;
	state = 86;
	nextstate = 89;
	question = "_Do you think there will be fighting?_";
	text1 = "_There may be violence someday, but we're hoping to avoid it for a while. There are nowhere near enough troops here to have a chance against the Empire. We just have to keep them from finding us._";

begintalknode;
	state = 89;
	nextstate = -1;
	question = "_How did you build this big giant fort without being detected?_";
	text1 = "_We are on the continent of Valorim, or so I'm told. It is the least settled of the Empire continents. Lucky for us. Fort Emergence is in the middle of a remote, unsettled area._";
	text2 = "_But it won't be unsettled forever. Whatever you're doing for the Crown, you'd better do it quick._";
	
begintalknode;
	state = 86;
	nextstate = 88;
	question = "_Tell me about Marian._";
	text1 = "_We came up here from Avernum together. We're sort of inseparable, you know._ He grins happily and rocks on the balls of his feet.";
begintalknode;
	state = 88;
	nextstate = -1;
	condition = gf(21,17) >= 1;
	question = "_I've met Marian. She seems nice._";
	text1 = "He grins. _Oh, she is! She is!_";

begintalknode;
	state = 85;
	nextstate = 87;
	question = "_Do you have a lot of supplies here?_";
	text1 = "_Yep. It takes a lot to feed an army, after all. By the way, you the lot that's going up to the surface? If so, the stuff in the side supply room is for you. Help yourselves!_";
	text2 = "_It's also there for your storage use._";

begintalknode;
	state = 87;
	nextstate = -1;
	question = "_Can I store anything there?_";
	text1 = "_Sure. If you have too much stuff, leave the excess in the side storeroom. We'll watch it to make sure nothing happens to it._";
	text2 = "_Of course, you can leave things everywhere in Fort Emergence. Just don't leave too many items around. If you leave too much clutter, some of it will be cleaned up, I'm afraid._";
	text3 = "(When you leave items sitting around on the ground and leave town, they will still be here when you return.)";

begintalknode;
	state = 85;
	nextstate = -1;
	question = "_You're an officer? Any useful quests for adventurers?_";
	text1 = "_Well, I am an officer, but I'm not authorized to hire adventurers. They're in too short supply to be allotted to me, I'm afraid. You should find Commander Johnson. He might be looking for someone._";
	text3 = "_You want a quest? I'm surprised. Aren't you supposed to be busy fulfilling your end of the contract with the Empire? All I could give you is crude gear. Nothing compared to what you looted outside._";
	action = DEP_ON_SDF 308 8 0;

// Commander Johnson

begintalknode;
	tag = 120;
	state = -1;
	nextstate = 113;
	question = "Commander Johnson";
	text1 = "You approach a gaunt, severe man, with a regal bearing and cruel eyes. His armor bears the insignia of a commander. When you approach, he is eating stew and dry bread. At first, you think he doesn't notice your presence. Then he motions with his hand for you to join him.";
	text2 = "He looks across the table at you with detached interest. _I am Commander Johnson. You are the secondary surface crew, yes? I think you can be useful to us. If you want._";
	text5 = "Commander Johnson watches you coldly as he chews a hunk of stew beef. _What else do you want?_";
	action = INTRO;

begintalknode;
	state = 113;
	nextstate = 114;
	question = "_Are you the leader of this fort?_";
	text1 = "_I have complete command of all soldiers in this fortress._ That doesn't include you. You answer to Anaximander, head of Unspecified Services in Fort Emergence.";

begintalknode;
	state = 114;
	nextstate = 115;
	question = "_Only the soldiers?_";
	text1 = "_Yes. I command soldiers. Which you aren't. Someday, we're going to have to slay all those Empire bastards, and when we do, it'll be the soldiers who do the work._";

begintalknode;
	state = 115;
	nextstate = -1;
	question = "_Do you really believe we'll eventually have to destroy the Empire?_";
	text1 = "_Yes, that's right. Slay all of them. And you and your other 'Unspecified Services' wastes of air will be no good to anybody. It's your turn now. But someday, it'll be up to the men. Not the kids._ ";
	text3 = "_Yes, that's right. Slay all of them. Don't think I am fooled for a moment by this foolish talk of a 'Contract' with Empress Prazac. If you think the Empire would ever deal fair with us, you are desperately naive._";
	action = DEP_ON_SDF 308 8 0;

begintalknode;
	state = 113;
	nextstate = 116;
	condition = gf(12,11) >= 1;
	question = "_I heard that you know how to get into the bunker._";
	text1 = "He looks startled. _Who told you about that?_";

begintalknode;
	state = 116;
	nextstate = -1;
	question = "_Sandra._";
	text1 = "He looks furious. _Damn her! I was only required to tell you if you asked._ He seems to be trying to think of a way out of it, but he soon thinks better of it.";
	text2 = "_All right. The bunker is in New Cotra. To enter it, walk up to the center of the east side, and say 'Galros.' Now you can go and waste our valuable resources. Well done._";
	action = SET_SDF 42 0 1;
	code =
		toggle_quest(107,10);
	break;
	
begintalknode;
	state = 113;
	nextstate = -1;
	question = "_You called us the secondary surface crew?_";
	text1 = "_Why yes. Did you not know? You were only selected to go to the surface after all qualified applicants disappeared without a trace._ He sighs. _A waste. Don't worry. Your loss will harm Avernum much less._";
	text3 = "_Of course. You were only selected to go to the surface after all qualified applicants disappeared without a trace. I heard you found the remains of one of your predecessors, yes? Perhaps, with luck, you will not meet the same fate for a while longer._";
	action = DEP_ON_SDF 307 14 2;

begintalknode;
	state = 113;
	nextstate = 118;
	condition = gf(21,11) <= 1;
	question = "_You said that I could be useful to you? I could use some experience._";
	text1 = "_Well, there is something so negligible I don't want to waste my people's time on it. A tribe of goblins have settled into a warren not far from here, in Upper Avernum. They haven't caused us trouble yet. They will soon._";
	text2 = "_Break in and kill their chief. That should disperse them for a while._";
	action = SET_SDF 21 11 1;
	code =
		toggle_quest(121,1);
	break;
	
begintalknode;
	state = 118;
	nextstate = -1;
	condition = 1;
	question = "_How can I find them?_";
	text1 = "_Leave Fort Emergence to the south, and follow the road. Watch the east wall of the main gallery. Look for signs of those dirty creatures._";

begintalknode;
	state = 118;
	nextstate = -1;
	condition = 1;
	question = "_What sort of trouble can they cause?_";
	text1 = "_Attacking travelers and merchants, most likely. They haven't started yet, but they will soon. Better if they die before they get the chance._";

begintalknode;
	state = 118;
	nextstate = -1;
	condition = 1;
	question = "_How do you know they have a chief?_";
	text1 = "_They always do. It's the only way their clan would be bold enough to set up so close to our fortress. Don't know its name, though. I haven't been able to catch a goblin for questioning yet._";

begintalknode;
	state = 113;
	nextstate = -1;
	condition = gf(21,11) == 1 && gf(44,11) > 0;
	question = "_The goblin chief is dead._";
	text1 = "You tell Johnson the tale. _Good. You show signs of competence. I should reward you, so your chances on the surface improve._ He removes a pair of gloves from his pouch and hands them to you.";
	text2 = "_If you need a little more practice before the real work begins, I have another job for you._";
	code = 
		set_flag(21,11,2);
		toggle_quest(121,3);
		award_party_xp(MED_QUEST_XP,2);
		reward_give(182);
		change_reputation(1);
	break;		

begintalknode;
	state = 113;
	nextstate = 117;
	condition = (gf(21,11) == 2) || (gf(21,11) == 3);
	question = "_You have more work for me?_";
	text1 = "_Another minor task, though more challenging than goblins. There's a bandit lair in Upper Avernum, north of the goblin lair. Kill their bandit leader, and I may give you some sort of modest reward._";
	code = 
		set_flag(21,11,3);
		toggle_quest(15,1);
	break;

begintalknode;
	state = 117;
	nextstate = -1;
	question = "_How can I find the bandits?_";
	text1 = "_Well, you could bother to actually look. Go to the graveyard of the goblin chief. Go north. My scouts saw signs of the bandit camp in the east tunnels of the main gallery not far from there._";

begintalknode;
	state = 117;
	nextstate = -1;
	question = "_What do you know about their leader?_";
	text1 = "_The bandits only call him 'The Grinder.' That is all I was able to get out of the bandit we caught and I questioned._";
	text2 = "_The fool was even more scared of his commander than he was of me. This 'Grinder' might actually be impressive._";
	
begintalknode;
	state = 113;
	nextstate = -1;
	condition = gf(21,11) == 3 && gf(45,11) >= 1;
	question = "_I killed The Grinder, as you requested. My reward?_";
	code =
		run_hardcode(1);
	break;

begintalknode;
	state = 113;
	nextstate = -1;
	condition = gf(21,11) >= 4;
	question = "_Any more quests I can do for you?_";
	text1 = "Commander Johnson snorts. _I thought you had actual important things to do. Anaximander will be pleased to hear that you are frittering your time away doing my errands._";

// Elisa

begintalknode;
	tag = 140;
	state = -1;
	nextstate = 141;
	question = "Elisa";
	text1 = "A very old, very round woman stirs a pot of savory lizard stew. She is surrounded with enough kitchen supplies to feed an army. Which is, you suppose, her job.";
	text2 = "_Welcome, child. I am Elisa._ She has the pale skin and sickly look common to long-time Avernites.";
	text5 = "_There is something you need, child? I can feed you, if you wish._ Her tone of voice makes it clear that would please her more.";
	action = INTRO;

begintalknode;
	state = 141;
	nextstate = 142;
	question = "_That's quite a pile of food you're making._";
	text1 = "_Naturally. I provide hot meals to all my children. I also, if asked very nicely, provide rations for troopers going out on trips._";

begintalknode;
	state = 142;
	nextstate = 143;
	question = "_Your children?_";
	text1 = "_Once I had children of my own, but they grew up and left. After that, I had the skills to cook for a horde, but no horde to cook for._";

begintalknode;
	state = 143;
	nextstate = -1;
	question = "_Now we are your horde._";
	text1 = "_Yes, now I cook for a somewhat older horde. Avernum troops eat a lot, but not much more than my nine kids did!_ She chuckles at that. She seems like she's about to tell you a story about her family, and then thinks better of it.";

begintalknode;
	state = 143;
	nextstate = 144;
	question = "_Did you have children in Avernum?_";
	text1 = "She shakes her head. _I could never bring a child into that dark, dank place. All of my child-rearing was done when I was forty and got sent into Avernum._";

begintalknode;
	state = 144;
	nextstate = -1;
	question = "_Why were you sent to Avernum?_";
	text1 = "_One day, in the inn where I worked, I cooked a pile of food for some travelers. Alas, unbeknownst to me, they were rebels. They were caught and killed. I was accused of aiding them, and into Avernum I went. I was robbed of ever seeing my grandchildren._";
	text2 = "_I didn't care back then, one way or another, about the Empire. But I hate it now, with all my heart._ She smiles. _But you don't want to hear the ramblings of an old woman, not when your stomachs are grumbling._";

begintalknode;
	state = 141;
	nextstate = -1;
	question = "_I could use some rations. Please._";
	action = END_TALK;
	code =
	run_hardcode(102);
	break;

// Gordon

begintalknode;
	tag = 160;
	state = -1;
	nextstate = 169;
	question = "Gordon";
	text1 = "You meet a young, scrawny man with short, sandy brown hair. He is cleaning this meal hall, occasionally pausing to gnaw at a piece of venison jerky. _Real meat, foraged from the surface! We don't have anything like this below!_";
	text2 = "He nods respectfully as you join him. _Greetings to you, adventurer! I am Gordon._";
	text5 = "Gordon stops by the table to take a drink of proper surface ale. _Delicious. Can I help you with anything else, adventurer? I am at your service._";
	action = INTRO;

begintalknode;
	state = 169;
	nextstate = 170;
	question = "_Exactly what is it you do?_";
	text1 = "_Well, I'm sort of the servant for the guest quarters. I sort of keep everything clean, prepare meals, that sort of thing._";

begintalknode;
	state = 170;
	nextstate = 171;
	question = "_Why would the guests get their own servant?_";
	text1 = "_Well, when important guests such as yourselves come, they expect to be treated well, with as much luxury as we can summon. That sort of thing. Unfortunately, there's one problem._";

begintalknode;
	state = 170;
	nextstate = 172;
	question = "_Can you get me some food, please?_";
	text1 = "He looks nervous. _Ummm, there's a bit of a problem with that. The fort is sort of not entirely ready, and I don't have the supplies up here to cook yet. Perhaps if you went to see Elisa? This is where I got my meal._";

begintalknode;
	state = 172;
	nextstate = -1;
	question = "_Fine. Where is Elisa?_";
	text1 = "_She runs the main kitchen, in the southwest corner of the fort. She gives lots of food to anyone who asks!_";

begintalknode;
	state = 171;
	nextstate = 173;
	question = "_I'm an important guest?_";
	text1 = "He looks at you as if you are terribly important. _You're the most important guest we've had yet! Why, you're going to be one of the first explorers to seriously look around on the surface!_";
	text2 = "He says, without irony, _I really envy you._";

begintalknode;
	state = 173;
	nextstate = -1;
	question = "_I suppose that I am very fortunate._";
	text1 = "_To go out on the surface! And maybe even survive! What I would give to be you! Be sure to come back and tell me what it's like!_";
	text3 = "_Why, you are the talk of the fort! Every day, we trade gossip about what you have been doing and finding up there. Anaximander wants the information to stay secret, but little bits of it leak out._";
	action = DEP_ON_SDF 308 9 0;

begintalknode;
	state = 171;
	nextstate = 174;
	question = "_That problem would be?_";
	text1 = "_Well, we're trying to get the fort ready for all the troops that will eventually be here. Unfortunately, we're not totally ready yet._ He looks scared.";
	text2 = "_Please don't try to get me into trouble! It's not my fault if anything goes wrong! I just sweep!_";

begintalknode;
	state = 174;
	nextstate = -1;
	question = "_I thought you just said you are responsible for the guest quarters?_";
	text1 = "_Yes, and this is my main responsibility._ He grabs a broom and sweeps a little, by way of demonstration.";

begintalknode;
	state = 169;
	nextstate = 175;
	question = "_Do you know where I can find some supplies?_";
	text1 = "_Oh, that reminds me! I was supposed to tell you. There is a storeroom to the west, south of Anaximander's office. There's a side room there with a bunch of stuff for you._";
	text3 = "_Now that you've already been out on the surface? I don't know. I think there's someone named Levy who is in charge of giving things out. His office is to the west. I think. I don't ever get over there much. I mostly sweep._";
	action = DEP_ON_SDF 308 9 0;

begintalknode;
	state = 175;
	nextstate = -1;
	question = "_Where can I find him?_";
	text1 = "_Leave the guest quarters and go across the main central cave to the west. The important people all have their offices in the northwest corner._";

// Yanmitho

begintalknode;
	tag = 1040;
	state = -1;
	nextstate = 1001;
	question = "Yanmitho";
	text1 = "A young, lithe woman moves gracefully in the center of the room, performing various martial exercises. A vicious, curved sword is sheathed at her side. When you approach, she gives you a stiff bow.";
	text2 = "_Apologies. Just keeping in shape until more soldiers arrive for training. Welcome. I am Yanmitho, the trainer for Fort Emergence._";
	text5 = "Yanmitho rests her hand lightly on the blade at her belt. _Anything else?_ She seems to wish your conversation to come to an end.";
	action = INTRO;

begintalknode;
	state = 1001;
	nextstate = 1002;
	question = "_Who do you train?_";
	text1 = "_I am here to train elite soldiers, helping them perfect their skills for the most dangerous missions._";
	text2 = "_I can also train ... others._ She says 'others' with mild disdain. You can't help but guess her contempt is aimed at you.";
	text3 = "She looks you over. _I've heard that you are functioning at a very high level. I might help you reach a new level of performance. I am surprised to find myself saying it._";
	code =
		if (average_level() < 6)
			rs(3);
			else rs(2);
	break;

begintalknode;
	state = 1002;
	nextstate = 1003;
	condition = average_level() < 6;
	question = "_Do you have some problem with me?_";
	text1 = "_You work for Unspecified Services, do you not? I am not afraid to say I have little respect for your lot._";

begintalknode;
	state = 1002;
	nextstate = 1003;
	condition = average_level() >= 6;
	question = "_Surprised? Why?_";
	text1 = "_You work for Unspecified Services, do you not? I am not afraid to say I have little respect for your undisciplined lot._";

begintalknode;
	state = 1003;
	nextstate = 1004;
	question = "_We are all fighting the same enemy!_";
	text1 = "_Pfaugh!_ She spits. _Unspecified Services is a ragtag band of untrained adventurers, amateur spies, and mixed hangers-on. We soldiers train hard and die for our cause. You wander around aimlessly and expect respect._";
	text2 = "_And yet, King Micah gives the first contact with the surface to your undisciplined lot._ She spits again.";

begintalknode;
	state = 1004;
	nextstate = 1001;
	question = "_King Micah is a wise ruler, and I will not tolerate any insults of our sovereign._";
	text1 = "_Of course. It is not to such as me to question the wisdom of my monarch._ She pauses and thinks. _Even if he is wrong._";

begintalknode;
	state = 1004;
	nextstate = 1001;
	question = "_Let's just talk about something else._";
	text1 = "_Gladly._";

begintalknode;
	state = 1003;
	nextstate = -1;
	condition = gf(308,8) >= 1;
	question = "_I helped negotiate peace between the Empire and Avernum!_";
	text1 = "_Oh, well done. You have delayed slightly the next bloody war between us and the Empire. How can you be so foolish as to think that your efforts will make any difference? They are our enemy, and that is the end of it._";

begintalknode;
	state = 1001;
	nextstate = -1;
	question = "_I would like basic training._";
	text1 = "You conclude your training.";	
	code = 
		begin_shop_mode("Yanmitho",
		  "Yanmitho knows a few very simple magical spells and can run you through the motions to cast them. (You can pay money to improve each spell two times.)",
		  29,3,0);	
	break;
	
begintalknode;
	state = 1001;
	nextstate = -1;
	condition = average_level() < 6;
	question = "_I would like advanced training._";
	text1 = "_I am under orders to train you to the best of my ability, but only when I find you ready. You aren't yet. Go out onto the surface and prove yourself worthy of my aid._";
	
begintalknode;
	state = 1001;
	nextstate = 1005;
	condition = average_level() >= 6;
	question = "_I would like advanced training._";
	text1 = "_I am under orders to train you to the best of my ability, although I am also allowed to require payment for the expenses of my department. Let me know when you are ready._";

begintalknode;
	state = 1005;
	nextstate = -1;
	question = "_You charge people for training?_";
	text1 = "_Occasionally. I train all soldiers as best I can, and I do not expect the slightest compensation. However, I also have to train those who are, like you, from Unspecified Services._";
	text2 = "_I am forced to train you, but my department has many expenses, and I am allowed to require you to help defray them._ She gives you a nasty smile.";

begintalknode;
	state = 1005;
	nextstate = -1;
	question = "_I would like training._";
	text1 = "You conclude your training.";	
	code = 
		begin_shop_mode("Yanmitho",
		  "Yanmitho can improve your effectiveness in basic battle skills. (You can pay money to improve each skill two times.)",
		  1,3,0);	
	break;

begintalknode;
	state = 1005;
	nextstate = -1;
	question = "_That is all I need._";
	text1 = "_Then I will return to my exercises. Excuse me._";
	action = END_TALK;
	
// Berra

begintalknode;
	tag = 1060;
	state = -1;
	nextstate = 1029;
	question = "Berra";
	text1 = "You meet a small, bent wizard, heavy with years. He is sitting at this desk poring over a thick book, researching esoteric topics you could never begin to comprehend.";
	text2 = "You clear your throat to get his attention. He squints up at you and croaks, _I am Berra. I hope you are not here to waste my time._";
	text3 = "_If you have gathered any useful evidence on the surface, turn it in here. I've been told that I have to look at it._";
	text5 = "Berra looks up at you, but his eyes are unfocused. He may be talking with you, but it is clear that his mind is wandering in realms far away. _What?_";
	text6 = "_If you have gathered any useful evidence on the surface, turn it in here. I've been told that I have to look at it._";
	action = INTRO;
	code =
		if (gf(308,10) == 0) {
			rs(3); rs(6);
			}
	break;
			
begintalknode;
	state = 1029;
	nextstate = 1030;
	question = "_What are you working on?_";
	text1 = "_I mainly concern myself with doing research. If only the facilities here were adequate._";

begintalknode;
	state = 1030;
	nextstate = 1032;
	question = "_How are the facilities lacking?_";
	text1 = "He croaks in irritation. _Now, if I was at the Tower of Magi, I would have all the tomes and materials I need! But here, I have little to work with._";

begintalknode;
	state = 1030;
	nextstate = 1031;
	question = "_What sort of research are you doing?_";
	text1 = "_Devising immensely powerful spells, communicating with beings beyond your comprehension, gaining absolute power. Nothing you could possibly understand. You're probably just here to waste my time._";
	text3 = "He grunts. _I'm supposed to fritter away my time analyzing any evidence you can provide to determine who is responsible for the devastation on the surface. If you have evidence, give it to me. Otherwise, go away._";
	action = DEP_ON_SDF 308 10 0;

begintalknode;
	state = 1031;
	nextstate = -1;
	condition = gf(308,10) >= 1;
	question = "_Do you have any ideas about who is causing the devastation on the surface?_";
	text1 = "_As if I could know about any of that. I do all my work in this cave. You are the one who explores. Why can't you just leave me to my work?_";

begintalknode;
	state = 1032;
	nextstate = -1;
	question = "_What is the Tower of Magi like?_";
	text1 = "_The Tower of Magi is the center of magical learning in Avernum. Oh, what I would give to be there! The research I could perform!_";
	text3 = "He grunts in anger. _Eternal curses on that Linda! She destroyed the greatest center of learning in Avernum, perhaps the world! Oh, the research I could be doing were it not for her. I'm glad she's dead._";
	action = DEP_ON_SDF 308 5 0;

begintalknode;
	state = 1031;
	nextstate = -1;
	condition = gf(308,10) >= 1;
	question = "_My mission is vital to our people. It will determine if we are ever to live on the surface again._";
	text1 = "He grunts angrily at you. _Fine. I'm supposed to fritter away my time analyzing any evidence you may provide to determine who is responsible for the devastation on the surface. So if you have evidence, give it to me, or go away._";

begintalknode;
	state = 1029;
	nextstate = 1033;
	question = "_Can you give me magical training?_";
	text1 = "He looks at you with confusion, then shock, then anger. _Do I look like some teacher? Some professor? Some guide for mere adventurers? The training hall is to the north. Bother them and leave me in peace._";

begintalknode;
	state = 1033;
	nextstate = -1;
	question = "_Why are you so rude? Aren't we all in this together?_";
	text1 = "_Apparently not._";

begintalknode;
	state = 1029;
	nextstate = -1;
	condition = gf(308,10) >= 1;
	question = "_I have ended one of the monster plagues on the surface. I may have evidence for you._";
	code =
		run_hardcode(103);
	break;

// Mazumdar

begintalknode;
	tag = 1080;
	state = -1;
	nextstate = 1057;
	question = "Mazumdar";
	text1 = "This woman is quite young, probably in her mid-twenties, Yet, she radiates power and authority well beyond her years. She levels a piercing gaze at you. _I am Mazumdar, Head Mage of Fort Emergence._";
	text2 = "She's carrying a pot in her hands. It contains an actual surface flower!";
	text5 = "the mage Mazumdar smiles at you. _What else is it you need, traveler?_ You notice that she has the slightly translucent skin common to people born in Avernum. She is still holding her flower.";
	action = INTRO;

begintalknode;
	state = 1057;
	nextstate = 1058;
	question = "_So what do you do here, exactly?_";
	text1 = "_I coordinate all magical activities that take place in Fort Emergence._";

begintalknode;
	state = 1058;
	nextstate = -1;
	question = "_Why is that important?_";
	text1 = "_Coordination is very important. If two mages attempt conflicting spells simultaneously in close quarters, it can ..._ She draws her finger across her throat in a slitting sort of motion.";

begintalknode;
	state = 1058;
	nextstate = 1059;
	question = "_What sorts of magical activities go on here?_";
	text1 = "_Little, for now. We are hiding from the Empire. Concealment spells and research, mainly. This fort will eventually be used for experimentation, training, and launching magical spells against our foes._";
	text2 = "_However, the Triad keeps us from being nearly as powerful as we could be._";

begintalknode;
	state = 1058;
	nextstate = 1059;
	question = "_Does this fort have many mages?_";
	text1 = "_This fort is still painfully understaffed. However, if we have our way, it will soon be a great center of magical power._ She grimaces. _That is, if the Triad allows it._";

begintalknode;
	state = 1059;
	nextstate = 1060;
	question = "_What is the Triad and why are they interfering?_";
	text1 = "_The Triad consists of the three greatest mages of Avernum, based in the Tower of Magi. They are in charge of all things magical. Unfortunately, they tend to not want to let power out of their control._";
	text2 = "_For that reason, our resources are nowhere near what they could be._ She grins. _With exceptions._";

begintalknode;
	state = 1060;
	nextstate = 1061;
	question = "_Exceptions such as...?_";
	text1 = "_We are supposed to be training mages here. Yet, the Triad won't let us have the books to teach spells from._";
	text2 = "She grins mischievously. _However, we've managed to sneak a few things past them. We need those tomes, after all._";

begintalknode;
	state = 1061;
	nextstate = -1;
	question = "_That sounds interesting. May I read some of your tomes?_";
	code =
		sf(22,27,1);
		run_hardcode(104);
	break;

begintalknode;
	state = 1057;
	nextstate = -1;
	condition = gf(22,27) > 0
	question = "_May I read some of your magical tomes?_";
	code =
		run_hardcode(104);
	break;

begintalknode;
	state = 1057;
	nextstate = 1062;
	question = "_You are doing research with surface plants?_";
	text1 = "_Why, of course! When the first group went out to explore the surface, they came back with surface plants, surface animals, dirt, all sorts of things for us!_";

begintalknode;
	state = 1062;
	nextstate = -1;
	question = "_What sort of plant are you holding?_";
	text1 = "_I am told that it was called a dandy lion. Something like that. It is very strange, but the more we relearn about surface ways, the better we will understand what it does._";

begintalknode;
	state = 1062;
	nextstate = -1;
	question = "_Why do you need to research things on the surface?_";
	text1 = "_Remember, it has been years since the last people were sent to Avernum. For years, all any of us have known about the surface came from books or hazy memories. I was born in Avernum. I've only spent a few hours outside, getting samples._";
	text2 = "_So this laboratory is engaged in the act of relearning. We need to rediscover knowledge people on the surface take for granted._";

begintalknode;
	state = 1062;
	nextstate = -1;
	question = "_Can you make potions?_";
	text1 = "_Alas, nobody in Fort Emergence can brew potions. This is an oversight that desperately needs to be corrected._";

begintalknode;
	state = 1057;
	nextstate = -1;
	question = "_Can you teach me magical spells?_";
	text1 = "_I'm sorry. I think Yanmitho and Eva can give that sort of training. Talk to them._";

// Eva

begintalknode;
	tag = 1000;
	state = -1;
	nextstate = 1085;
	question = "Eva";
	text1 = "This young woman's robes were probably clean this morning. Now, they have bits of fur and tiny clumps of dung on them. She curtsies to you, self-consciously brushing fur and such off her robe as she does so. _I'm Eva._";
	text2 = "_I am of the Church of the Seeking Soul. We obtain knowledge, and then we share it._";
	text5 = "Eva continues to pick at the dirt on her robe. _I can spare some more time from my research. What would you like to speak of?_";
	text6 = "You notice that her skin is translucent and her hair is prematurely graying. Reliable signs that she was born in Avernum.";
	action = INTRO;

begintalknode;
	state = 1085;
	nextstate = 1086;
	question = "_What sort of work are you doing?_";
	text1 = "_I'm here to research the flora and fauna of the surface world. Spies brought some samples back._";
	text2 = "_We can also magically summon samples from the surface world, examine them in their cells, and teleport them back up. And, if they are damaged, I heal them._";

begintalknode;
	state = 1086;
	nextstate = 1087;
	question = "_What is this flora of which you speak?_";
	text1 = "_You know, plants? If you find any unusual creatures on the surface, ask me about them. Maybe I'll know something!_";
	code =
		sf(22,28,1);
	break;

begintalknode;
	state = 1086;
	nextstate = 1087;
	question = "_What is fauna?_";
	text1 = "_Animals. If you find any unusual creatures on the surface, ask me about them. Maybe I'll know something!_";
	code =
		sf(22,28,1);
	break;
	
begintalknode;
	state = 1086;
	nextstate = -1;
	question = "_Why do you use teleportation to gather your specimens?_";
	text1 = "_It's a difficult technique, but remember ... we need to stay hidden from the Empire as long as possible._";

begintalknode;
	state = 1086;
	nextstate = -1;
	question = "_Do you have anything in the cells now?_";
	text1 = "_There are some interesting samples in there right now. Please don't let them out._";

begintalknode;
	state = 1085;
	nextstate = 1089;
	condition = gf(22,28) > 0;
	question = "_I'd like to learn more about the life of the surface world._";
	text1 = "_I am under orders to help you. I have learned about the fierce monsters of the outside, like the 'wolf' and the 'bear.'_";

begintalknode;
	state = 1089;
	nextstate = -1;
	question = "_What is that round, white, furry thing in the north cell?_";
	text1 = "_The surface people call it a 'sheep'. It is a very stupid surface meat creature._";

begintalknode;
	state = 1089;
	nextstate = 1090;
	question = "_Tell me about 'bears' and 'wolves'?_";
	text1 = "_Surface carnivores. They'll take a bite out of you if they get the chance. They may even be full of unspeakable evil._";

begintalknode;
	state = 1090;
	nextstate = -1;
	question = "_Have you done any research on wolves?_";
	text1 = "_Wolves are occasionally vicious, furry creatures, slightly smaller and less dangerous than giant lizards. Beware worgs, though. A worg is a type of wolf, bred for huge size, ill-temper, and a dim malevolent intelligence._";

begintalknode;
	state = 1090;
	nextstate = -1;
	question = "_What have you learned of bears?_";
	text1 = "_They are large and potentially dangerous, although, usually, they would be more than happy to just leave you alone. You should, however, beware the ursagi._";
	text2 = "_The ursagi are a sort of intelligent, mutant bear. They're very evil. We captured one, and it almost picked the lock of its cell with its claw. It would have been a horrible mess if it had escaped!_";

begintalknode;
	state = 1089;
	nextstate = -1;
	condition = gf(307,4) >= 1;
	question = "_Have you seen any of the cockroaches on the surface?_";
	text1 = "_Normally, cockroaches are small insect pests on the surface world. Giant evil roaches, however, such as you have found, are definitely an aberration. Assuredly a magical creation._";

begintalknode;
	state = 1089;
	nextstate = -1;
	condition = gf(307,6) >= 1;
	question = "_Have you come across any information about troglodytes or giants?_";
	text1 = "_I tend to know more about animals. I know little of humanoids. The troglodytes you have seen, however, are not native to the surface, as far as I know._";

begintalknode;
	state = 1089;
	nextstate = -1;
	condition = gf(307,1) >= 1;
	question = "_Have you examined any of the surface slimes?_";
	text1 = "_They sound fascinating, but I know nothing of them. They are not, as far as I know, native to either the surface or the underworld. They seem to have been recently, magically created._";

begintalknode;
	state = 1089;
	nextstate = -1;
	condition = gf(308,1) >= 1;
	question = "_We encountered some alien beasts on the surface. Do you know much about them?_";
	text1 = "She looks very concerned. _I have never heard of anything like the alien beasts. Alarming creatures. Creatures of magical origin and devastating strength._";

begintalknode;
	state = 1085;
	nextstate = -1;
	question = "_Can I learn more about your holy rituals?_";
	text1 = "You conclude your training.";	
	code = 
		begin_shop_mode("Eva",
		  "Eva is mainly a sage, but she can help you learn some of the more simple holy rituals. (You can pay money to improve each spell two times.)",
		  30,3,0);	
	break;
	
begintalknode;
	state = 1085;
	nextstate = -1;
	condition = 1;
	question = "_I'll be going now._";
	text1 = "_Farewell. I hope you find wisdom on your path, and that you share it._";
	action = END_TALK;


// Ilona

begintalknode;
	tag = 1160;
	state = -1;
	nextstate = 1169;
	question = "Ilona";
	text1 = "A short, middle-aged woman with heavy chain armor watches the south gate, which leads to Upper Avernum. She keeps a short, wicked-looking spear close at hand.";
	text2 = "_I am Ilona._ Her voice has a heavy accent you can't quite place. _I am guarding here._";
	text5 = "Ilona nods to you. _How else can I be helping you?_";
	action = INTRO;

begintalknode;
	state = 1169;
	nextstate = 1170;
	question = "_What are you guarding?_";
	text1 = "_I am watching the rear gate. Not a risky job, is true, but one that needs the doing._ Her speech is very strange.";

begintalknode;
	state = 1170;
	nextstate = -1;
	question = "_So all is quiet?_";
	text1 = "_Yes, yes. If the attack is to come from the Empire, from the north it will come. From the south, all I see are fresh green troops and supplies. So many supplies, it is unbelievable._";
	text2 = "_Out this way is Upper Avernum. Mainly the caves, and a few Avernum towns._";

begintalknode;
	state = 1170;
	nextstate = -1;
	question = "_The south gate isn't as important?_";
	text1 = "_It is not like north gate. That is the way to the sunny lands, and so has many guards. If the Empire is finding us, the north gate is where it will be bloody quickly._";

begintalknode;
	state = 1169;
	nextstate = 1171;
	question = "_Where are you from? I can't quite place your accent._";
	text1 = "She looks embarrassed that you mention it. _I am from very far away. I speak other language, and then get banished to Avernum. I had to learn quickly. My apologies._";

begintalknode;
	state = 1170;
	nextstate = -1;
	question = "_Can you tell me anything about what is past this gate?_";
	text1 = "_Leave to the south, and you will be in large cave, many miles across, that Avernum just settled. Many towns are there. Just follow the roads._";

begintalknode;
	state = 1171;
	nextstate = -1;
	question = "_Why were you banished to Avernum?_";
	text1 = "_An official was telling me to do things, foolish things, and I told him what I thought of the things he said I should be doing. And so all this happens to me! Unbelievable!_";

// Thereza

begintalknode;
	tag = 1180;
	state = -1;
	nextstate = 1197;
	question = "Thereza";
	text1 = "You meet a young woman with long dark hair. She is walking around the main gallery of Fort Emergence in nervous circles.";
	text2 = "She seems to know who you are already, and she is uncomfortable when you approach. _Um. Hello. I am Thereza._";
	text5 = "Thereza still seems uncomfortable. _What else do you want?_";
	action = INTRO;

begintalknode;
	state = 1197;
	nextstate = -1;
	condition = gf(307,0) == 0;
	question = "_I am supposed to meet someone named Anaximander._";
	text1 = "_Oh. Our boss. I can help. That is easy. Enter the warehouse to the west. Go north from there. Our offices are there._";
	
begintalknode;
	state = 1197;
	nextstate = 1198;
	question = "_What are your responsibilities?_";
	text1 = "_I'm with Unspecified Services, like you._";

begintalknode;
	state = 1198;
	nextstate = 1199;
	question = "_Tell me what you know about Unspecified Services._";
	text1 = "_Well, first, don't ask too many questions._ She sighs. _We are the department of spies, lone wolf mages, adventurers, and everyone else working for Avernum that isn't in the army. Also the source of eternal resentment on the part of the military._";
	text2 = "_We both are on assignment for Unspecified Services, at the moment._";

begintalknode;
	state = 1199;
	nextstate = 1200;
	question = "_Have you been informed of what we are to accomplish?_";
	text1 = "_Your job is to gather information on the surface. I am the contact for the others being sent up there. Others besides you, that is._";

begintalknode;
	state = 1200;
	nextstate = -1;
	question = "_There are others being sent as well?_";
	text1 = "_Yes, others. You didn't think something so important would be left to just you, eh?_ She pauses. _And more than that I am not cleared to say. Sorry._";
	text2 = "She turns away.";
	action = END_TALK;

begintalknode;
	state = 1199;
	nextstate = -1;
	question = "_Why does the military resent us?_";
	text1 = "_The military resents us because they don't control us and we do many things better than them. So don't expect much help from them._";

begintalknode;
	state = 1197;
	nextstate = 1201;
	question = "_You seem very uncomfortable. Why?_";
	text1 = "_Because we both work for Unspecified Services. The key word is covert. We deal in secrets. And if I tell you things, those things are no longer secrets, and you might give them up._";
	text2 = "_Nothing personal. You just can't be allowed to know what I know._";

begintalknode;
	state = 1197;
	nextstate = -1;
	question = "_Do you already know who I am?_";
	text1 = "_Don't be dense. Everyone here knows who you are. You're the surface explorer. You're important. When you aren't around, people gossip about you._";

begintalknode;
	state = 1201;
	nextstate = 1202;
	condition = gf(21,12) <= 1;
	question = "_Is that the only reason you're uncomfortable?_";
	text1 = "_Well, almost. You see, I was supposed to get a bundle of records from the Portal Fort. It was supposed to get here weeks ago, but there has been no sign of the courier. It's nothing crucial, but I really wish those papers would arrive._";
	action = SET_SDF 21 12 1;
	code =
		toggle_quest(16,1);
	break;

begintalknode;
	state = 1202;
	nextstate = -1;
	question = "_Maybe I could help find them._";
	text1 = "_Maybe. I wouldn't waste your time with it, though._";
	text2 = "_Anyway, you should visit the Portal Fort sometimes. Can be useful. Leave Fort Emergence to the south. Stick to the road. Follow the signs. The courier disappeared somewhere between here and there._";
	
begintalknode;
	state = 1197;
	nextstate = -1;
	condition = gf(21,12) == 1 && has_spec_item(14) > 0;
	question = "_I found those papers you were waiting for. The courier was killed._";
	code =
		run_hardcode(2);
	break;



// Habecker

begintalknode;
	tag = 2080;
	state = -1;
	nextstate = 2057;
	question = "Habecker";
	text1 = "You meet a portly bearded man in nondescript robes. He wanders around the main gallery of the fort, clearly quite bored. _Oh, hello. I'm Habecker. How are you?_";
	text5 = "Habecker is pleased to be chatting with you. Anything to relieve his boredom.";
	action = INTRO;

begintalknode;
	state = 2057;
	nextstate = 2058;
	question = "_What job do you have here?_";
	text1 = "_Well, I was hired to do research for the fort. Which is why I'm so bored._";

begintalknode;
	state = 2058;
	nextstate = -1;
	question = "_What sort of research?_";
	text1 = "_I'm a sage by trade. I was brought here to gather and study samples from the surface world. That's why being here is so boring!_";
	text2 = "_If only I could find someone interested in my abilities._ He looks at you meaningfully.";

begintalknode;
	state = 2058;
	nextstate = 2059;
	question = "_Are you bored because you have nothing to study?_";
	text1 = "_Yes, I came here to study things from the surface world. However, they won't let me go up there to study! So I spend my time down here, wandering back and forth, waiting for permission to emerge._";

begintalknode;
	state = 2059;
	nextstate = 2060;
	question = "_What interests you the most about the surface world?_";
	text1 = "_All the things to explore! All the amazing creatures we've forgotten about and need to rediscover. I hear they have a thing called a ... Bird! Can you imagine?_";

begintalknode;
	state = 2060;
	nextstate = -1;
	question = "_What is this thing you call a bird?_";
	text1 = "_It flies. Or breathes fire. Or eats eyes. Or something. I keep hearing different stories. I'll never know for sure until I can get to the surface._";

begintalknode;
	state = 2057;
	nextstate = 2061;
	question = "_You have robes. Are you a wizard?_";
	text1 = "_No. Common mistake. I am a sage. I just won't be able to do any of my work until they let me go outside._";

begintalknode;
	state = 2061;
	nextstate = 2062;
	question = "_Why won't they let you onto the surface?_";
	text1 = "_The powers that be are desperate to keep the Empire from learning the location of Fort Emergence. That is why only people from Unspecified Services, like you, are the only people let out._";

begintalknode;
	state = 2062;
	nextstate = -1;
	condition = gf(307,0) == 0;
	question = "_Speaking of which, I'm supposed to meet someone named Anaximander._";
	text1 = "_I've heard of him. Unspecified Services, right? His offices are in the northwest corner of the fort._";

